<!DOCTYPE html>
<html lang="zh-CN" dir="ltr">
  <head>
    <meta charset="utf-8">
    <meta name="viewport" content="width=device-width,initial-scale=1">
    <title>Date | 山奈Galanga</title>
    <meta name="description" content="山奈Galanga是一个开源的JS函数库">
    <link rel="preload stylesheet" href="/assets/style.534e13ff.css" as="style">
    <script type="module" src="/assets/app.1a865d5c.js"></script>
    <link rel="preload" href="/assets/inter-roman-latin.2ed14f66.woff2" as="font" type="font/woff2" crossorigin="">
  <link rel="modulepreload" href="/assets/chunks/framework.fd4dbc48.js">
  <link rel="modulepreload" href="/assets/chunks/theme.9f2685f5.js">
  <link rel="modulepreload" href="/assets/api_date.md.118822c8.lean.js">
  <script async="true" src="https://www.googletagmanager.com/gtag/js?id=G-KDRRLCH82B"></script>
  <script>window.dataLayer=window.dataLayer||[];function gtag(){dataLayer.push(arguments)}gtag("js",new Date),gtag("config","G-KDRRLCH82B");</script>
  <link rel="icon" type="image/svg+xml" href="/logo.svg">
  <script id="check-dark-light">(()=>{const e=localStorage.getItem("vitepress-theme-appearance")||"",a=window.matchMedia("(prefers-color-scheme: dark)").matches;(!e||e==="auto"?a:e==="dark")&&document.documentElement.classList.add("dark")})();</script>
  </head>
  <body>
    <div id="app"><div class="Layout" data-v-abcc630f><!--[--><!--]--><!--[--><span tabindex="-1" data-v-151f2593></span><a href="#VPContent" class="VPSkipLink visually-hidden" data-v-151f2593> Skip to content </a><!--]--><!----><header class="VPNav" data-v-abcc630f data-v-0fa0e57d><div class="VPNavBar has-sidebar" data-v-0fa0e57d data-v-be450ad9><div class="container" data-v-be450ad9><div class="title" data-v-be450ad9><div class="VPNavBarTitle has-sidebar" data-v-be450ad9 data-v-6d2fb2d9><a class="title" href="/" data-v-6d2fb2d9><!--[--><!--]--><!--[--><img class="VPImage logo" src="/logo.svg" alt data-v-6db2186b><!--]--><!--[-->Galanga<!--]--><!--[--><!--]--></a></div></div><div class="content" data-v-be450ad9><div class="curtain" data-v-be450ad9></div><div class="content-body" data-v-be450ad9><!--[--><!--]--><div class="VPNavBarSearch search" data-v-be450ad9><!----><div id="docsearch"><button type="button" class="DocSearch DocSearch-Button" aria-label="Search"><span class="DocSearch-Button-Container"><svg width="20" height="20" class="DocSearch-Search-Icon" viewBox="0 0 20 20"><path d="M14.386 14.386l4.0877 4.0877-4.0877-4.0877c-2.9418 2.9419-7.7115 2.9419-10.6533 0-2.9419-2.9418-2.9419-7.7115 0-10.6533 2.9418-2.9419 7.7115-2.9419 10.6533 0 2.9419 2.9418 2.9419 7.7115 0 10.6533z" stroke="currentColor" fill="none" fill-rule="evenodd" stroke-linecap="round" stroke-linejoin="round"></path></svg><span class="DocSearch-Button-Placeholder">Search</span></span><span class="DocSearch-Button-Keys"><span class="DocSearch-Button-Key">Meta</span><span class="DocSearch-Button-Key">K</span></span></button></div></div><nav aria-labelledby="main-nav-aria-label" class="VPNavBarMenu menu" data-v-be450ad9 data-v-bdedfc22><span id="main-nav-aria-label" class="visually-hidden" data-v-bdedfc22>Main Navigation</span><!--[--><!--[--><a class="VPLink link VPNavBarMenuLink" href="/" tabindex="0" data-v-bdedfc22 data-v-bbf845a0 data-v-a8b5c975><!--[-->首页<!--]--><!----></a><!--]--><!--[--><a class="VPLink link VPNavBarMenuLink" href="/guide/" tabindex="0" data-v-bdedfc22 data-v-bbf845a0 data-v-a8b5c975><!--[-->指引<!--]--><!----></a><!--]--><!--[--><a class="VPLink link VPNavBarMenuLink" href="/api/" tabindex="0" data-v-bdedfc22 data-v-bbf845a0 data-v-a8b5c975><!--[-->API<!--]--><!----></a><!--]--><!--[--><div class="VPFlyout VPNavBarMenuGroup" data-v-bdedfc22 data-v-96001b6b><button type="button" class="button" aria-haspopup="true" aria-expanded="false" data-v-96001b6b><span class="text" data-v-96001b6b><!----> 站点切换 <svg xmlns="http://www.w3.org/2000/svg" aria-hidden="true" focusable="false" viewbox="0 0 24 24" class="text-icon" data-v-96001b6b><path d="M12,16c-0.3,0-0.5-0.1-0.7-0.3l-6-6c-0.4-0.4-0.4-1,0-1.4s1-0.4,1.4,0l5.3,5.3l5.3-5.3c0.4-0.4,1-0.4,1.4,0s0.4,1,0,1.4l-6,6C12.5,15.9,12.3,16,12,16z"></path></svg></span></button><div class="menu" data-v-96001b6b><div class="VPMenu" data-v-96001b6b data-v-e7ea1737><div class="items" data-v-e7ea1737><!--[--><!--[--><div class="VPMenuLink" data-v-e7ea1737 data-v-88f937c6><a class="VPLink link" href="https://galanga.censujiang.com" target="_blank" rel="noreferrer" data-v-88f937c6 data-v-a8b5c975><!--[-->官方文档<!--]--><svg xmlns="http://www.w3.org/2000/svg" aria-hidden="true" focusable="false" height="24px" viewbox="0 0 24 24" width="24px" class="icon" data-v-a8b5c975><path d="M0 0h24v24H0V0z" fill="none"></path><path d="M9 5v2h6.59L4 18.59 5.41 20 17 8.41V15h2V5H9z"></path></svg></a></div><!--]--><!--[--><div class="VPMenuLink" data-v-e7ea1737 data-v-88f937c6><a class="VPLink link" href="https://galanga.censujiang.cn" target="_blank" rel="noreferrer" data-v-88f937c6 data-v-a8b5c975><!--[-->中国镜像<!--]--><svg xmlns="http://www.w3.org/2000/svg" aria-hidden="true" focusable="false" height="24px" viewbox="0 0 24 24" width="24px" class="icon" data-v-a8b5c975><path d="M0 0h24v24H0V0z" fill="none"></path><path d="M9 5v2h6.59L4 18.59 5.41 20 17 8.41V15h2V5H9z"></path></svg></a></div><!--]--><!--]--></div><!--[--><!--]--></div></div></div><!--]--><!--]--></nav><!----><div class="VPNavBarAppearance appearance" data-v-be450ad9 data-v-da3f667a><label title="toggle dark mode" data-v-da3f667a data-v-2eaa5496><button class="VPSwitch VPSwitchAppearance" type="button" role="switch" aria-checked="false" data-v-2eaa5496 data-v-f3c41672><span class="check" data-v-f3c41672><span class="icon" data-v-f3c41672><!--[--><svg xmlns="http://www.w3.org/2000/svg" aria-hidden="true" focusable="false" viewbox="0 0 24 24" class="sun" data-v-2eaa5496><path d="M12,18c-3.3,0-6-2.7-6-6s2.7-6,6-6s6,2.7,6,6S15.3,18,12,18zM12,8c-2.2,0-4,1.8-4,4c0,2.2,1.8,4,4,4c2.2,0,4-1.8,4-4C16,9.8,14.2,8,12,8z"></path><path d="M12,4c-0.6,0-1-0.4-1-1V1c0-0.6,0.4-1,1-1s1,0.4,1,1v2C13,3.6,12.6,4,12,4z"></path><path d="M12,24c-0.6,0-1-0.4-1-1v-2c0-0.6,0.4-1,1-1s1,0.4,1,1v2C13,23.6,12.6,24,12,24z"></path><path d="M5.6,6.6c-0.3,0-0.5-0.1-0.7-0.3L3.5,4.9c-0.4-0.4-0.4-1,0-1.4s1-0.4,1.4,0l1.4,1.4c0.4,0.4,0.4,1,0,1.4C6.2,6.5,5.9,6.6,5.6,6.6z"></path><path d="M19.8,20.8c-0.3,0-0.5-0.1-0.7-0.3l-1.4-1.4c-0.4-0.4-0.4-1,0-1.4s1-0.4,1.4,0l1.4,1.4c0.4,0.4,0.4,1,0,1.4C20.3,20.7,20,20.8,19.8,20.8z"></path><path d="M3,13H1c-0.6,0-1-0.4-1-1s0.4-1,1-1h2c0.6,0,1,0.4,1,1S3.6,13,3,13z"></path><path d="M23,13h-2c-0.6,0-1-0.4-1-1s0.4-1,1-1h2c0.6,0,1,0.4,1,1S23.6,13,23,13z"></path><path d="M4.2,20.8c-0.3,0-0.5-0.1-0.7-0.3c-0.4-0.4-0.4-1,0-1.4l1.4-1.4c0.4-0.4,1-0.4,1.4,0s0.4,1,0,1.4l-1.4,1.4C4.7,20.7,4.5,20.8,4.2,20.8z"></path><path d="M18.4,6.6c-0.3,0-0.5-0.1-0.7-0.3c-0.4-0.4-0.4-1,0-1.4l1.4-1.4c0.4-0.4,1-0.4,1.4,0s0.4,1,0,1.4l-1.4,1.4C18.9,6.5,18.6,6.6,18.4,6.6z"></path></svg><svg xmlns="http://www.w3.org/2000/svg" aria-hidden="true" focusable="false" viewbox="0 0 24 24" class="moon" data-v-2eaa5496><path d="M12.1,22c-0.3,0-0.6,0-0.9,0c-5.5-0.5-9.5-5.4-9-10.9c0.4-4.8,4.2-8.6,9-9c0.4,0,0.8,0.2,1,0.5c0.2,0.3,0.2,0.8-0.1,1.1c-2,2.7-1.4,6.4,1.3,8.4c2.1,1.6,5,1.6,7.1,0c0.3-0.2,0.7-0.3,1.1-0.1c0.3,0.2,0.5,0.6,0.5,1c-0.2,2.7-1.5,5.1-3.6,6.8C16.6,21.2,14.4,22,12.1,22zM9.3,4.4c-2.9,1-5,3.6-5.2,6.8c-0.4,4.4,2.8,8.3,7.2,8.7c2.1,0.2,4.2-0.4,5.8-1.8c1.1-0.9,1.9-2.1,2.4-3.4c-2.5,0.9-5.3,0.5-7.5-1.1C9.2,11.4,8.1,7.7,9.3,4.4z"></path></svg><!--]--></span></span></button></label></div><div class="VPSocialLinks VPNavBarSocialLinks social-links" data-v-be450ad9 data-v-2ab2a029 data-v-f6988cfb><!--[--><a class="VPSocialLink" href="https://github.com/censujiang/galanga" aria-label="github" target="_blank" rel="noopener" data-v-f6988cfb data-v-92b28dff><svg role="img" viewBox="0 0 24 24" xmlns="http://www.w3.org/2000/svg"><title>GitHub</title><path d="M12 .297c-6.63 0-12 5.373-12 12 0 5.303 3.438 9.8 8.205 11.385.6.113.82-.258.82-.577 0-.285-.01-1.04-.015-2.04-3.338.724-4.042-1.61-4.042-1.61C4.422 18.07 3.633 17.7 3.633 17.7c-1.087-.744.084-.729.084-.729 1.205.084 1.838 1.236 1.838 1.236 1.07 1.835 2.809 1.305 3.495.998.108-.776.417-1.305.76-1.605-2.665-.3-5.466-1.332-5.466-5.93 0-1.31.465-2.38 1.235-3.22-.135-.303-.54-1.523.105-3.176 0 0 1.005-.322 3.3 1.23.96-.267 1.98-.399 3-.405 1.02.006 2.04.138 3 .405 2.28-1.552 3.285-1.23 3.285-1.23.645 1.653.24 2.873.12 3.176.765.84 1.23 1.91 1.23 3.22 0 4.61-2.805 5.625-5.475 5.92.42.36.81 1.096.81 2.22 0 1.606-.015 2.896-.015 3.286 0 .315.21.69.825.57C20.565 22.092 24 17.592 24 12.297c0-6.627-5.373-12-12-12"/></svg></a><a class="VPSocialLink" href="https://gitee.com/censujiang/galanga" aria-label target="_blank" rel="noopener" data-v-f6988cfb data-v-92b28dff><svg t="1675442450278" class="icon" viewBox="0 0 1024 1024" version="1.1" xmlns="http://www.w3.org/2000/svg" p-id="1945" width="24" height="24"><path d="M512 1024C230.4 1024 0 793.6 0 512S230.4 0 512 0s512 230.4 512 512-230.4 512-512 512z m259.2-569.6H480c-12.8 0-25.6 12.8-25.6 25.6v64c0 12.8 12.8 25.6 25.6 25.6h176c12.8 0 25.6 12.8 25.6 25.6v12.8c0 41.6-35.2 76.8-76.8 76.8h-240c-12.8 0-25.6-12.8-25.6-25.6V416c0-41.6 35.2-76.8 76.8-76.8h355.2c12.8 0 25.6-12.8 25.6-25.6v-64c0-12.8-12.8-25.6-25.6-25.6H416c-105.6 0-188.8 86.4-188.8 188.8V768c0 12.8 12.8 25.6 25.6 25.6h374.4c92.8 0 169.6-76.8 169.6-169.6v-144c0-12.8-12.8-25.6-25.6-25.6z" fill="#888888" p-id="1946"></path></svg></a><!--]--></div><div class="VPFlyout VPNavBarExtra extra" data-v-be450ad9 data-v-66bb1f24 data-v-96001b6b><button type="button" class="button" aria-haspopup="true" aria-expanded="false" aria-label="extra navigation" data-v-96001b6b><svg xmlns="http://www.w3.org/2000/svg" aria-hidden="true" focusable="false" viewbox="0 0 24 24" class="icon" data-v-96001b6b><circle cx="12" cy="12" r="2"></circle><circle cx="19" cy="12" r="2"></circle><circle cx="5" cy="12" r="2"></circle></svg></button><div class="menu" data-v-96001b6b><div class="VPMenu" data-v-96001b6b data-v-e7ea1737><!----><!--[--><!--[--><!----><div class="group" data-v-66bb1f24><div class="item appearance" data-v-66bb1f24><p class="label" data-v-66bb1f24>Appearance</p><div class="appearance-action" data-v-66bb1f24><label title="toggle dark mode" data-v-66bb1f24 data-v-2eaa5496><button class="VPSwitch VPSwitchAppearance" type="button" role="switch" aria-checked="false" data-v-2eaa5496 data-v-f3c41672><span class="check" data-v-f3c41672><span class="icon" data-v-f3c41672><!--[--><svg xmlns="http://www.w3.org/2000/svg" aria-hidden="true" focusable="false" viewbox="0 0 24 24" class="sun" data-v-2eaa5496><path d="M12,18c-3.3,0-6-2.7-6-6s2.7-6,6-6s6,2.7,6,6S15.3,18,12,18zM12,8c-2.2,0-4,1.8-4,4c0,2.2,1.8,4,4,4c2.2,0,4-1.8,4-4C16,9.8,14.2,8,12,8z"></path><path d="M12,4c-0.6,0-1-0.4-1-1V1c0-0.6,0.4-1,1-1s1,0.4,1,1v2C13,3.6,12.6,4,12,4z"></path><path d="M12,24c-0.6,0-1-0.4-1-1v-2c0-0.6,0.4-1,1-1s1,0.4,1,1v2C13,23.6,12.6,24,12,24z"></path><path d="M5.6,6.6c-0.3,0-0.5-0.1-0.7-0.3L3.5,4.9c-0.4-0.4-0.4-1,0-1.4s1-0.4,1.4,0l1.4,1.4c0.4,0.4,0.4,1,0,1.4C6.2,6.5,5.9,6.6,5.6,6.6z"></path><path d="M19.8,20.8c-0.3,0-0.5-0.1-0.7-0.3l-1.4-1.4c-0.4-0.4-0.4-1,0-1.4s1-0.4,1.4,0l1.4,1.4c0.4,0.4,0.4,1,0,1.4C20.3,20.7,20,20.8,19.8,20.8z"></path><path d="M3,13H1c-0.6,0-1-0.4-1-1s0.4-1,1-1h2c0.6,0,1,0.4,1,1S3.6,13,3,13z"></path><path d="M23,13h-2c-0.6,0-1-0.4-1-1s0.4-1,1-1h2c0.6,0,1,0.4,1,1S23.6,13,23,13z"></path><path d="M4.2,20.8c-0.3,0-0.5-0.1-0.7-0.3c-0.4-0.4-0.4-1,0-1.4l1.4-1.4c0.4-0.4,1-0.4,1.4,0s0.4,1,0,1.4l-1.4,1.4C4.7,20.7,4.5,20.8,4.2,20.8z"></path><path d="M18.4,6.6c-0.3,0-0.5-0.1-0.7-0.3c-0.4-0.4-0.4-1,0-1.4l1.4-1.4c0.4-0.4,1-0.4,1.4,0s0.4,1,0,1.4l-1.4,1.4C18.9,6.5,18.6,6.6,18.4,6.6z"></path></svg><svg xmlns="http://www.w3.org/2000/svg" aria-hidden="true" focusable="false" viewbox="0 0 24 24" class="moon" data-v-2eaa5496><path d="M12.1,22c-0.3,0-0.6,0-0.9,0c-5.5-0.5-9.5-5.4-9-10.9c0.4-4.8,4.2-8.6,9-9c0.4,0,0.8,0.2,1,0.5c0.2,0.3,0.2,0.8-0.1,1.1c-2,2.7-1.4,6.4,1.3,8.4c2.1,1.6,5,1.6,7.1,0c0.3-0.2,0.7-0.3,1.1-0.1c0.3,0.2,0.5,0.6,0.5,1c-0.2,2.7-1.5,5.1-3.6,6.8C16.6,21.2,14.4,22,12.1,22zM9.3,4.4c-2.9,1-5,3.6-5.2,6.8c-0.4,4.4,2.8,8.3,7.2,8.7c2.1,0.2,4.2-0.4,5.8-1.8c1.1-0.9,1.9-2.1,2.4-3.4c-2.5,0.9-5.3,0.5-7.5-1.1C9.2,11.4,8.1,7.7,9.3,4.4z"></path></svg><!--]--></span></span></button></label></div></div></div><div class="group" data-v-66bb1f24><div class="item social-links" data-v-66bb1f24><div class="VPSocialLinks social-links-list" data-v-66bb1f24 data-v-f6988cfb><!--[--><a class="VPSocialLink" href="https://github.com/censujiang/galanga" aria-label="github" target="_blank" rel="noopener" data-v-f6988cfb data-v-92b28dff><svg role="img" viewBox="0 0 24 24" xmlns="http://www.w3.org/2000/svg"><title>GitHub</title><path d="M12 .297c-6.63 0-12 5.373-12 12 0 5.303 3.438 9.8 8.205 11.385.6.113.82-.258.82-.577 0-.285-.01-1.04-.015-2.04-3.338.724-4.042-1.61-4.042-1.61C4.422 18.07 3.633 17.7 3.633 17.7c-1.087-.744.084-.729.084-.729 1.205.084 1.838 1.236 1.838 1.236 1.07 1.835 2.809 1.305 3.495.998.108-.776.417-1.305.76-1.605-2.665-.3-5.466-1.332-5.466-5.93 0-1.31.465-2.38 1.235-3.22-.135-.303-.54-1.523.105-3.176 0 0 1.005-.322 3.3 1.23.96-.267 1.98-.399 3-.405 1.02.006 2.04.138 3 .405 2.28-1.552 3.285-1.23 3.285-1.23.645 1.653.24 2.873.12 3.176.765.84 1.23 1.91 1.23 3.22 0 4.61-2.805 5.625-5.475 5.92.42.36.81 1.096.81 2.22 0 1.606-.015 2.896-.015 3.286 0 .315.21.69.825.57C20.565 22.092 24 17.592 24 12.297c0-6.627-5.373-12-12-12"/></svg></a><a class="VPSocialLink" href="https://gitee.com/censujiang/galanga" aria-label target="_blank" rel="noopener" data-v-f6988cfb data-v-92b28dff><svg t="1675442450278" class="icon" viewBox="0 0 1024 1024" version="1.1" xmlns="http://www.w3.org/2000/svg" p-id="1945" width="24" height="24"><path d="M512 1024C230.4 1024 0 793.6 0 512S230.4 0 512 0s512 230.4 512 512-230.4 512-512 512z m259.2-569.6H480c-12.8 0-25.6 12.8-25.6 25.6v64c0 12.8 12.8 25.6 25.6 25.6h176c12.8 0 25.6 12.8 25.6 25.6v12.8c0 41.6-35.2 76.8-76.8 76.8h-240c-12.8 0-25.6-12.8-25.6-25.6V416c0-41.6 35.2-76.8 76.8-76.8h355.2c12.8 0 25.6-12.8 25.6-25.6v-64c0-12.8-12.8-25.6-25.6-25.6H416c-105.6 0-188.8 86.4-188.8 188.8V768c0 12.8 12.8 25.6 25.6 25.6h374.4c92.8 0 169.6-76.8 169.6-169.6v-144c0-12.8-12.8-25.6-25.6-25.6z" fill="#888888" p-id="1946"></path></svg></a><!--]--></div></div></div><!--]--><!--]--></div></div></div><!--[--><!--]--><button type="button" class="VPNavBarHamburger hamburger" aria-label="mobile navigation" aria-expanded="false" aria-controls="VPNavScreen" data-v-be450ad9 data-v-e5dd9c1c><span class="container" data-v-e5dd9c1c><span class="top" data-v-e5dd9c1c></span><span class="middle" data-v-e5dd9c1c></span><span class="bottom" data-v-e5dd9c1c></span></span></button></div></div></div></div><!----></header><div class="VPLocalNav" data-v-abcc630f data-v-2dcb6fa6><button class="menu" aria-expanded="false" aria-controls="VPSidebarNav" data-v-2dcb6fa6><svg xmlns="http://www.w3.org/2000/svg" aria-hidden="true" focusable="false" viewbox="0 0 24 24" class="menu-icon" data-v-2dcb6fa6><path d="M17,11H3c-0.6,0-1-0.4-1-1s0.4-1,1-1h14c0.6,0,1,0.4,1,1S17.6,11,17,11z"></path><path d="M21,7H3C2.4,7,2,6.6,2,6s0.4-1,1-1h18c0.6,0,1,0.4,1,1S21.6,7,21,7z"></path><path d="M21,15H3c-0.6,0-1-0.4-1-1s0.4-1,1-1h18c0.6,0,1,0.4,1,1S21.6,15,21,15z"></path><path d="M17,19H3c-0.6,0-1-0.4-1-1s0.4-1,1-1h14c0.6,0,1,0.4,1,1S17.6,19,17,19z"></path></svg><span class="menu-text" data-v-2dcb6fa6>Menu</span></button><div class="VPLocalNavOutlineDropdown" style="--vp-vh:0px;" data-v-2dcb6fa6 data-v-ab3c7793><button class="" data-v-ab3c7793>On this page <svg xmlns="http://www.w3.org/2000/svg" aria-hidden="true" focusable="false" viewbox="0 0 24 24" class="icon" data-v-ab3c7793><path d="M9,19c-0.3,0-0.5-0.1-0.7-0.3c-0.4-0.4-0.4-1,0-1.4l5.3-5.3L8.3,6.7c-0.4-0.4-0.4-1,0-1.4s1-0.4,1.4,0l6,6c0.4,0.4,0.4,1,0,1.4l-6,6C9.5,18.9,9.3,19,9,19z"></path></svg></button><!----></div></div><aside class="VPSidebar" data-v-abcc630f data-v-c79ccefa><div class="curtain" data-v-c79ccefa></div><nav class="nav" id="VPSidebarNav" aria-labelledby="sidebar-aria-label" tabindex="-1" data-v-c79ccefa><span class="visually-hidden" id="sidebar-aria-label" data-v-c79ccefa> Sidebar Navigation </span><!--[--><!--]--><!--[--><div class="group" data-v-c79ccefa><section class="VPSidebarItem level-0 has-active" data-v-c79ccefa data-v-5d3c8d52><!----><div class="items" data-v-5d3c8d52><!--[--><div class="VPSidebarItem level-1 is-link" data-v-5d3c8d52 data-v-5d3c8d52><div class="item" data-v-5d3c8d52><div class="indicator" data-v-5d3c8d52></div><a class="VPLink link link" href="/api/" data-v-5d3c8d52 data-v-a8b5c975><!--[--><p class="text" data-v-5d3c8d52>前言</p><!--]--><!----></a><!----></div><!----></div><div class="VPSidebarItem level-1 is-link" data-v-5d3c8d52 data-v-5d3c8d52><div class="item" data-v-5d3c8d52><div class="indicator" data-v-5d3c8d52></div><a class="VPLink link link" href="/api/cookie" data-v-5d3c8d52 data-v-a8b5c975><!--[--><p class="text" data-v-5d3c8d52>饼干Cookie</p><!--]--><!----></a><!----></div><!----></div><div class="VPSidebarItem level-1 is-link" data-v-5d3c8d52 data-v-5d3c8d52><div class="item" data-v-5d3c8d52><div class="indicator" data-v-5d3c8d52></div><a class="VPLink link link" href="/api/url" data-v-5d3c8d52 data-v-a8b5c975><!--[--><p class="text" data-v-5d3c8d52>网址URL</p><!--]--><!----></a><!----></div><!----></div><div class="VPSidebarItem level-1 is-link" data-v-5d3c8d52 data-v-5d3c8d52><div class="item" data-v-5d3c8d52><div class="indicator" data-v-5d3c8d52></div><a class="VPLink link link" href="/api/string" data-v-5d3c8d52 data-v-a8b5c975><!--[--><p class="text" data-v-5d3c8d52>字符串String</p><!--]--><!----></a><!----></div><!----></div><div class="VPSidebarItem level-1 is-link" data-v-5d3c8d52 data-v-5d3c8d52><div class="item" data-v-5d3c8d52><div class="indicator" data-v-5d3c8d52></div><a class="VPLink link link" href="/api/device" data-v-5d3c8d52 data-v-a8b5c975><!--[--><p class="text" data-v-5d3c8d52>设备Device</p><!--]--><!----></a><!----></div><!----></div><div class="VPSidebarItem level-1 is-link" data-v-5d3c8d52 data-v-5d3c8d52><div class="item" data-v-5d3c8d52><div class="indicator" data-v-5d3c8d52></div><a class="VPLink link link" href="/api/object" data-v-5d3c8d52 data-v-a8b5c975><!--[--><p class="text" data-v-5d3c8d52>对象Object</p><!--]--><!----></a><!----></div><!----></div><div class="VPSidebarItem level-1 is-link" data-v-5d3c8d52 data-v-5d3c8d52><div class="item" data-v-5d3c8d52><div class="indicator" data-v-5d3c8d52></div><a class="VPLink link link" href="/api/array" data-v-5d3c8d52 data-v-a8b5c975><!--[--><p class="text" data-v-5d3c8d52>数组Array</p><!--]--><!----></a><!----></div><!----></div><div class="VPSidebarItem level-1 is-link" data-v-5d3c8d52 data-v-5d3c8d52><div class="item" data-v-5d3c8d52><div class="indicator" data-v-5d3c8d52></div><a class="VPLink link link" href="/api/permission" data-v-5d3c8d52 data-v-a8b5c975><!--[--><p class="text" data-v-5d3c8d52>权限Permission</p><!--]--><!----></a><!----></div><!----></div><div class="VPSidebarItem level-1 is-link" data-v-5d3c8d52 data-v-5d3c8d52><div class="item" data-v-5d3c8d52><div class="indicator" data-v-5d3c8d52></div><a class="VPLink link link" href="/api/number" data-v-5d3c8d52 data-v-a8b5c975><!--[--><p class="text" data-v-5d3c8d52>数字Number</p><!--]--><!----></a><!----></div><!----></div><div class="VPSidebarItem level-1 is-link is-active has-active" data-v-5d3c8d52 data-v-5d3c8d52><div class="item" data-v-5d3c8d52><div class="indicator" data-v-5d3c8d52></div><a class="VPLink link link" href="/api/date" data-v-5d3c8d52 data-v-a8b5c975><!--[--><p class="text" data-v-5d3c8d52>时间Date</p><!--]--><!----></a><!----></div><!----></div><div class="VPSidebarItem level-1 is-link" data-v-5d3c8d52 data-v-5d3c8d52><div class="item" data-v-5d3c8d52><div class="indicator" data-v-5d3c8d52></div><a class="VPLink link link" href="/api/other" data-v-5d3c8d52 data-v-a8b5c975><!--[--><p class="text" data-v-5d3c8d52>杂项Other</p><!--]--><!----></a><!----></div><!----></div><!--]--></div></section></div><!--]--><!--[--><!--]--></nav></aside><div class="VPContent has-sidebar" id="VPContent" data-v-abcc630f data-v-fe5dac9b><div class="VPDoc has-sidebar has-aside" data-v-fe5dac9b data-v-e76d1fb6><div class="container" data-v-e76d1fb6><div class="aside" data-v-e76d1fb6><div class="aside-curtain" data-v-e76d1fb6></div><div class="aside-container" data-v-e76d1fb6><div class="aside-content" data-v-e76d1fb6><div class="VPDocAside" data-v-e76d1fb6 data-v-cdc66372><!--[--><!--]--><!--[--><!--]--><div class="VPDocAsideOutline" data-v-cdc66372 data-v-7f4425f6><div class="content" data-v-7f4425f6><div class="outline-marker" data-v-7f4425f6></div><div class="outline-title" data-v-7f4425f6>On this page</div><nav aria-labelledby="doc-outline-aria-label" data-v-7f4425f6><span class="visually-hidden" id="doc-outline-aria-label" data-v-7f4425f6> Table of Contents for current page </span><ul class="root" data-v-7f4425f6 data-v-e82ceacd><!--[--><!--]--></ul></nav></div></div><!--[--><!--]--><div class="spacer" data-v-cdc66372></div><!--[--><!--]--><!----><!--[--><!--]--><!--[--><!--]--></div></div></div></div><div class="content" data-v-e76d1fb6><div class="content-container" data-v-e76d1fb6><!--[--><!--]--><div class="VPDocOutlineDropdown" data-v-e76d1fb6 data-v-1c313eb9><button class="" data-v-1c313eb9>On this page <svg xmlns="http://www.w3.org/2000/svg" aria-hidden="true" focusable="false" viewbox="0 0 24 24" class="icon" data-v-1c313eb9><path d="M9,19c-0.3,0-0.5-0.1-0.7-0.3c-0.4-0.4-0.4-1,0-1.4l5.3-5.3L8.3,6.7c-0.4-0.4-0.4-1,0-1.4s1-0.4,1.4,0l6,6c0.4,0.4,0.4,1,0,1.4l-6,6C9.5,18.9,9.3,19,9,19z"></path></svg></button><!----></div><main class="main" data-v-e76d1fb6><div style="position:relative;" class="vp-doc _api_date" data-v-e76d1fb6><div><h1 id="date" tabindex="-1">Date <a class="header-anchor" href="#date" aria-label="Permalink to &quot;Date&quot;">​</a></h1><p>山奈提供了一些时间处理的工具函数</p><h2 id="aftertime" tabindex="-1"><code>afterTime</code><span class="VPBadge warning" data-v-350d3852><!--[-->beta<!--]--></span> <a class="header-anchor" href="#aftertime" aria-label="Permalink to &quot;`afterTime`&lt;Badge type=&quot;warning&quot; text=&quot;beta&quot; /&gt;&quot;">​</a></h2><h3 id="介绍" tabindex="-1">介绍 <a class="header-anchor" href="#介绍" aria-label="Permalink to &quot;介绍&quot;">​</a></h3><p>输出当前时间之后的时间</p><h3 id="导入" tabindex="-1">导入 <a class="header-anchor" href="#导入" aria-label="Permalink to &quot;导入&quot;">​</a></h3><div class="language-js"><button title="Copy Code" class="copy"></button><span class="lang">js</span><pre class="shiki material-theme-palenight"><code><span class="line"><span style="color:#89DDFF;font-style:italic;">import</span><span style="color:#A6ACCD;"> </span><span style="color:#89DDFF;">{</span><span style="color:#F07178;"> </span><span style="color:#A6ACCD;">afterTime</span><span style="color:#F07178;"> </span><span style="color:#89DDFF;">}</span><span style="color:#A6ACCD;"> </span><span style="color:#89DDFF;font-style:italic;">from</span><span style="color:#A6ACCD;"> </span><span style="color:#89DDFF;">&#39;</span><span style="color:#C3E88D;">galanga</span><span style="color:#89DDFF;">&#39;</span></span>
<span class="line"></span></code></pre></div><h3 id="使用" tabindex="-1">使用 <a class="header-anchor" href="#使用" aria-label="Permalink to &quot;使用&quot;">​</a></h3><p>输入参数如下：</p><ul><li>(必填)<code>time</code>：时间，可以是一个时间戳，也可以是一个时间字符串，也可以是一个 Date 对象</li><li><code>backType</code>：返回格式，可以是一个字符串，也可以是一个函数，如果是字符串，则返回一个时间字符串，如果是函数，则返回一个 Date 对象</li></ul><div class="vp-code-group"><div class="tabs"><input type="radio" name="group-xKLTp" id="tab-Sbv0S88" checked="checked"><label for="tab-Sbv0S88">按需引入</label><input type="radio" name="group-xKLTp" id="tab-LVOPn3I"><label for="tab-LVOPn3I">全局引入</label></div><div class="blocks"><div class="language-js active"><button title="Copy Code" class="copy"></button><span class="lang">js</span><pre class="shiki material-theme-palenight"><code><span class="line"><span style="color:#82AAFF;">afterTime</span><span style="color:#A6ACCD;">(time</span><span style="color:#89DDFF;">,</span><span style="color:#A6ACCD;"> backType)</span></span>
<span class="line"></span></code></pre></div><div class="language-js"><button title="Copy Code" class="copy"></button><span class="lang">js</span><pre class="shiki material-theme-palenight"><code><span class="line"><span style="color:#A6ACCD;">galanga</span><span style="color:#89DDFF;">.</span><span style="color:#82AAFF;">afterTime</span><span style="color:#A6ACCD;">(time</span><span style="color:#89DDFF;">,</span><span style="color:#A6ACCD;"> backType)</span></span>
<span class="line"></span></code></pre></div></div></div></div></div></main><footer class="VPDocFooter" data-v-e76d1fb6 data-v-7246529b><!--[--><!--]--><div class="edit-info" data-v-7246529b><div class="edit-link" data-v-7246529b><a class="VPLink link edit-link-button" href="https://github.com/censujiang/galanga/edit/master/wiki/api/date.md" target="_blank" rel="noreferrer" data-v-7246529b data-v-a8b5c975><!--[--><svg xmlns="http://www.w3.org/2000/svg" viewbox="0 0 24 24" class="edit-link-icon" aria-label="edit icon" data-v-7246529b><path d="M18,23H4c-1.7,0-3-1.3-3-3V6c0-1.7,1.3-3,3-3h7c0.6,0,1,0.4,1,1s-0.4,1-1,1H4C3.4,5,3,5.4,3,6v14c0,0.6,0.4,1,1,1h14c0.6,0,1-0.4,1-1v-7c0-0.6,0.4-1,1-1s1,0.4,1,1v7C21,21.7,19.7,23,18,23z"></path><path d="M8,17c-0.3,0-0.5-0.1-0.7-0.3C7,16.5,6.9,16.1,7,15.8l1-4c0-0.2,0.1-0.3,0.3-0.5l9.5-9.5c1.2-1.2,3.2-1.2,4.4,0c1.2,1.2,1.2,3.2,0,4.4l-9.5,9.5c-0.1,0.1-0.3,0.2-0.5,0.3l-4,1C8.2,17,8.1,17,8,17zM9.9,12.5l-0.5,2.1l2.1-0.5l9.3-9.3c0.4-0.4,0.4-1.1,0-1.6c-0.4-0.4-1.2-0.4-1.6,0l0,0L9.9,12.5z M18.5,2.5L18.5,2.5L18.5,2.5z"></path></svg> Edit this page<!--]--><!----></a></div><div class="last-updated" data-v-7246529b><p class="VPLastUpdated" data-v-7246529b data-v-355aa5ef>Last updated: <time datetime="2023-06-01T06:49:51.000Z" data-v-355aa5ef></time></p></div></div><div class="prev-next" data-v-7246529b><div class="pager" data-v-7246529b><a class="pager-link prev" href="/api/number" data-v-7246529b><span class="desc" data-v-7246529b>Previous page</span><span class="title" data-v-7246529b>数字Number</span></a></div><div class="has-prev pager" data-v-7246529b><a class="pager-link next" href="/api/other" data-v-7246529b><span class="desc" data-v-7246529b>Next page</span><span class="title" data-v-7246529b>杂项Other</span></a></div></div></footer><!--[--><!--]--></div></div></div></div></div><footer class="VPFooter has-sidebar" data-v-abcc630f data-v-d24360a6><div class="container" data-v-d24360a6><p class="message" data-v-d24360a6>Released under Apache License 2.0 and package version 0.2.7</p><p class="copyright" data-v-d24360a6>Copyright © 2014-2024 CensuJiang All Rights Reserved.</p></div></footer><!--[--><!--]--></div></div>
    <script>__VP_HASH_MAP__ = JSON.parse("{\"guide_index.md\":\"4b72fd29\",\"api_array.md\":\"a2e4b660\",\"guide_todo.md\":\"6ffa3d64\",\"api_cookie.md\":\"944de323\",\"api_date.md\":\"118822c8\",\"index.md\":\"2c6dfb6a\",\"api_object.md\":\"9e551357\",\"readme.md\":\"a84286f9\",\"api_other.md\":\"737e019c\",\"api_device.md\":\"8dd4cb4a\",\"api_index.md\":\"12ac22bc\",\"api_number.md\":\"25c34ba1\",\"guide_contribute.md\":\"5785b259\",\"guide_install.md\":\"de08d316\",\"api_url.md\":\"396cb1f8\",\"guide_changelog.md\":\"b84dbc84\",\"api_permission.md\":\"509cf628\",\"api_string.md\":\"c717a11f\"}")
__VP_SITE_DATA__ = JSON.parse("{\"lang\":\"zh-CN\",\"dir\":\"ltr\",\"title\":\"山奈Galanga\",\"description\":\"山奈Galanga是一个开源的JS函数库\",\"base\":\"/\",\"head\":[],\"appearance\":true,\"themeConfig\":{\"siteTitle\":\"Galanga\",\"logo\":\"/logo.svg\",\"nav\":[{\"text\":\"首页\",\"link\":\"/\"},{\"text\":\"指引\",\"link\":\"/guide/\"},{\"text\":\"API\",\"link\":\"/api/\"},{\"text\":\"站点切换\",\"items\":[{\"text\":\"官方文档\",\"link\":\"https://galanga.censujiang.com\"},{\"text\":\"中国镜像\",\"link\":\"https://galanga.censujiang.cn\"}]}],\"sidebar\":{\"/guide/\":[{\"text\":\"介绍\",\"items\":[{\"text\":\"入门\",\"link\":\"/guide/\"},{\"text\":\"安装\",\"link\":\"/guide/install\"}]},{\"text\":\"项目信息\",\"items\":[{\"text\":\"贡献指南\",\"link\":\"/guide/contribute\"},{\"text\":\"项目计划\",\"link\":\"/guide/todo\"},{\"text\":\"更新日志\",\"link\":\"/guide/changelog\"}]}],\"/api/\":[{\"text\":\"前言\",\"link\":\"/api/\"},{\"text\":\"饼干Cookie\",\"link\":\"/api/cookie\"},{\"text\":\"网址URL\",\"link\":\"/api/url\"},{\"text\":\"字符串String\",\"link\":\"/api/string\"},{\"text\":\"设备Device\",\"link\":\"/api/device\"},{\"text\":\"对象Object\",\"link\":\"/api/object\"},{\"text\":\"数组Array\",\"link\":\"/api/array\"},{\"text\":\"权限Permission\",\"link\":\"/api/permission\"},{\"text\":\"数字Number\",\"link\":\"/api/number\"},{\"text\":\"时间Date\",\"link\":\"/api/date\"},{\"text\":\"杂项Other\",\"link\":\"/api/other\"}]},\"editLink\":{\"pattern\":\"https://github.com/censujiang/galanga/edit/master/wiki/:path\"},\"socialLinks\":[{\"icon\":\"github\",\"link\":\"https://github.com/censujiang/galanga\"},{\"icon\":{\"svg\":\"<svg t=\\\"1675442450278\\\" class=\\\"icon\\\" viewBox=\\\"0 0 1024 1024\\\" version=\\\"1.1\\\" xmlns=\\\"http://www.w3.org/2000/svg\\\" p-id=\\\"1945\\\" width=\\\"24\\\" height=\\\"24\\\"><path d=\\\"M512 1024C230.4 1024 0 793.6 0 512S230.4 0 512 0s512 230.4 512 512-230.4 512-512 512z m259.2-569.6H480c-12.8 0-25.6 12.8-25.6 25.6v64c0 12.8 12.8 25.6 25.6 25.6h176c12.8 0 25.6 12.8 25.6 25.6v12.8c0 41.6-35.2 76.8-76.8 76.8h-240c-12.8 0-25.6-12.8-25.6-25.6V416c0-41.6 35.2-76.8 76.8-76.8h355.2c12.8 0 25.6-12.8 25.6-25.6v-64c0-12.8-12.8-25.6-25.6-25.6H416c-105.6 0-188.8 86.4-188.8 188.8V768c0 12.8 12.8 25.6 25.6 25.6h374.4c92.8 0 169.6-76.8 169.6-169.6v-144c0-12.8-12.8-25.6-25.6-25.6z\\\" fill=\\\"#888888\\\" p-id=\\\"1946\\\"></path></svg>\"},\"link\":\"https://gitee.com/censujiang/galanga\"}],\"footer\":{\"message\":\"Released under Apache License 2.0 and package version 0.2.7\",\"copyright\":\"Copyright © 2014-2024 CensuJiang All Rights Reserved.\"}},\"locales\":{},\"scrollOffset\":90,\"cleanUrls\":true}")</script>
    
  </body>
</html>